package com.oauth.service.application;

import java.util.Collection;
import java.util.List;
import java.util.Set;

import com.oauth.service.application.registry.beans.ApplicationInfoBean;
import com.oauth.service.generic.beans.OAuthServiceBean;
import com.oauth.service.generic.exception.OAuthServiceException;
import com.oauth.service.global.beans.GlobalDataType;

public interface ApplicationService {

	Set<Long> getUnsubscribedApplicationId(Long pMemberId) throws OAuthServiceException;

	List<ApplicationInfoBean> getUnsubscribedApplication(Long pMemberId)
			throws OAuthServiceException;

	Set<Long> getSubscribedApplicationId(Long pMemberId) throws OAuthServiceException;

	List<ApplicationInfoBean> getSubscribedApplication(Long pMemberId) throws OAuthServiceException;

	void unSubscribeApplication(Long pMemberId, Long pApplicationId) throws OAuthServiceException;

	Set<Long> getApplicationIdSetWithDataType(GlobalDataType pGlobalDataType);

	Set<Long> getApplicationIdSetWithDataTypeForMember(Long pMemberId,
			GlobalDataType pGlobalDataType) throws OAuthServiceException;

	Collection<ApplicationInfoBean> getApplicationInfo(Set<Long> pApplicationId);

	/**
	 * @param oauthServiceBean
	 * @throws OAuthServiceException
	 */
	void subscribeApplication(OAuthServiceBean oauthServiceBean) throws OAuthServiceException;

	/**
	 * @param memberId
	 * @param applicationId
	 * @return
	 * @throws OAuthServiceException
	 */
	OAuthServiceBean getToken(Long memberId, Long applicationId) throws OAuthServiceException;

	/**
	 * @param memberId
	 * @return
	 * @throws OAuthServiceException
	 */
	List<OAuthServiceBean> getAllTokens(Long memberId) throws OAuthServiceException;

	/**
	 * @param applicationId
	 * @return
	 */
	ApplicationInfoBean getApplicationInfo(Long applicationId);
}
